package org.example.service.Impl;

import org.example.common.ResponseMessage;
import org.example.entity.WorkPlan;
import org.example.entity.dto.WorkPlanDto;
import org.example.mapper.WorkPlanMapper;
import org.example.service.WorkPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WorkPlanServiceImpl implements WorkPlanService {
    @Autowired
    private WorkPlanMapper workPlanMapper;

    /**
     * 新增周计划
     * @param workPlanDto
     * @return
     */
    @Override
    public void addPlan(WorkPlanDto workPlanDto){
        workPlanMapper.insert(workPlanDto);
    }
    @Override
    public ResponseMessage delByID(Integer ID){
        int count = workPlanMapper.delWork(ID);
        if (count > 0){
            return ResponseMessage.success(null);
        }
        return ResponseMessage.error();
    }

    @Override
    public void update(WorkPlanDto workPlanDto){
        workPlanMapper.updateWork(workPlanDto);
    }


}
